﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DiemChapNhanThe.Data;
using DiemChapNhanThe.Entities;
using System.Data;

public partial class Tin_Tuc : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Data_Bind();
            ltrTieude.Text = "Tin Tức";
        }
    }
    protected void Data_Bind()
    {
        int TotalRows = 0;
        string Whereclause = "1=1";
        TList<TinTuc> Tlist_TinTuc = DataRepository.TinTucProvider.GetPaged(Whereclause, "NgayCapNhat DESC", 0, 5, out TotalRows);
        if (Tlist_TinTuc.Count > 0)
        {
            dlTinTuc.DataSource = Tlist_TinTuc;
            dlTinTuc.DataBind();
        }
        TList<TinTuc> Tlist_TinTucCu = DataRepository.TinTucProvider.GetPaged(Whereclause, "NgayCapNhat DESC", 6, 20, out TotalRows);
        if (Tlist_TinTucCu.Count > 0)
        {
            dlTinLienQuan.DataSource = Tlist_TinTucCu;
            dlTinLienQuan.DataBind();
        }
    }
    public string GetTieuDe(object Char)
    {
        string s = Char.ToString();
        return Common.ConvertToUnSign(s);
    }
}